using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Mvc.Mailer;
using System.Net.Mail;
using Stertex.Repository;
using Stertex.Common;
using System.Web.Mvc;

namespace www.Stertex.com.Mailers
{ 
    public class UserMailer : MailerBase, IUserMailer     
	{
		public UserMailer():
			base()
		{
			MasterName="_Layout";
		}

		
		public virtual MailMessage Welcome(Profile profile)
		{
			var mailMessage = new MailMessage{Subject = "Welcome"};
            string activationKey = SecurityHelper.Encrypt(profile.Email, true);

			mailMessage.To.Add(profile.Email);
            ViewBag.Data = profile;
            ViewBag.ActivationKey = activationKey;
            //UrlHelper url = new UrlHelper(this.ControllerContext.RequestContext);

            //ViewBag.ActivationUrl = url.Abs(url.Action("Activate", "Account", new { Key = activationKey}));
 

			PopulateBody(mailMessage, viewName: "Welcome");

			return mailMessage;
		}

		
		public virtual MailMessage PasswordReset()
		{
			var mailMessage = new MailMessage{Subject = "PasswordReset"};
			
			//mailMessage.To.Add("some-email@example.com");
			//ViewBag.Data = someObject;
			PopulateBody(mailMessage, viewName: "PasswordReset");

			return mailMessage;
		}

		
		public virtual MailMessage Confirmation()
		{
			var mailMessage = new MailMessage{Subject = "Confirmation"};
			
			//mailMessage.To.Add("some-email@example.com");
			//ViewBag.Data = someObject;
			PopulateBody(mailMessage, viewName: "Confirmation");

			return mailMessage;
		}

		
	}
}